package com.project.demo.entity;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

/**
 * @author Corgile
 * @date 2022-02-18
 */
@Component
@PropertySource("classpath:userBean.properties")
@ConfigurationProperties(prefix = "user-bean")
public class User {
	private String name;
	private Integer age;

	public User(String name, Integer age, String birth) {
		this.name = name;
		this.age = age;
		this.birth = birth;
	}

	public User() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getBirth() {
		return birth;
	}

	public void setBirth(String birth) {
		this.birth = birth;
	}

	private String birth;

	@Override
	public String toString() {

		return "User{" +
				"name='" + name + '\'' +
				", age=" + age +
				", birth='" + birth + '\'' +
				'}';
	}
}
